package thread;

public class SleepDemo02 {
    public static void main(String[] args) {
        Thread lin = new Thread("林") {
            public void run() {
                System.out.println(getName() + "刚美完容睡一会...");
                try {
                    Thread.sleep(999999999);
                } catch (InterruptedException e) {
                    System.out.println(getName() + "干嘛呢!干嘛呢!都破相了!");
                }
                System.out.println(getName() + "醒了");
            }
        };
        Thread huang = new Thread("黄") {
            public void run() {
                System.out.println(getName() + "大锤80,小锤40,搞定!");
                for (int i = 0; i < 5; i++) {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(getName() + "80");
                }
                System.out.println("咣当!");
                System.out.println(getName() + "大哥搞定!");
                lin.interrupt();
            }
        };
        lin.start();
        huang.start();

    }
}
